package cn.lystudio.rohm_time_op.mapper;

import cn.lystudio.rohm_time_op.entity.po.ShiftCapacityRecordPO;
import cn.lystudio.rohm_time_op.entity.vo.ShiftCapacityRecordVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ShiftCapacityRecordMapper extends BaseMapper<ShiftCapacityRecordPO> {
    @Select("SELECT record.*,users.userFullName \t\n" +
            "FROM t_shift_capacity_record record \t\n" +
            "LEFT JOIN t_users users ON users.userCode=record.userCode  " +
            "WHERE 1=1 \t\n" +
            "AND  record.machineNo=#{machineNo} \t\n" +
            "AND record.recordTimeDT > #{beginDate} \t\n" +
            "AND record.recordTimeDT <= #{endDate} \t\n " +
            "ORDER BY record.recordTimeDT DESC")
    List<ShiftCapacityRecordVO> getShiftCapaRecordTimeLine(@Param("machineNo")String machineNo, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
}
